/*
 * Singularity Engine
 * Copyright (C) 2010 Vyacheslav Vorobyov, All rights reserved.
 * See LICENSE for full license information.
 */

/**
 * 
 */
package org.singularity.mapred.model;

import org.singularity.mapred.MapFun;
import org.singularity.mapred.RedFun;
import org.singularity.mapred.ReduceElement;
import org.singularity.mapred.Source;

/**
 * @author vjache
 *
 */
public class DefaultReduceElement<KT,RT> extends AbstractElement implements ReduceElement<KT,RT> {

	private final RedFun<KT, RT> _redFun;

	public DefaultReduceElement(DefaultCascade aCascade, RedFun<KT, RT> aRedFun, Object aId) {
		super(aCascade,Code.Reducer,aId);
		_redFun = aRedFun;
	}

	@Override
	public RedFun<KT,RT> getFun() {
		return _redFun;
	}

	@Override
	public void inflow(Source aFrom, MapFun<RT, KT, ?> aMapFun) {
		_cascade.flow(aFrom, this, aMapFun);
	}

	
}
